﻿<UserControl x:Class="CPPEI.Coolzon.Designer.Views.PartTreeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:CPPEI.Coolzon.Designer.Views"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <TreeView Name="_ctlTreeViewPart" SelectedItemChanged="onCtlTreeViewPartSelectedItemChanged" TreeViewItem.PreviewMouseRightButtonDown="TreeViewItem_PreviewMouseRightButtonDown">
            <TreeView.ItemContainerStyle>
                <Style  TargetType="{x:Type TreeViewItem}">
                    <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
                    <Setter Property="IsSelected" Value="{Binding Path=IsSelected,Mode=TwoWay}" />
                </Style>
            </TreeView.ItemContainerStyle>
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate DataType="{x:Type local:PartTreeViewModel}" ItemsSource="{Binding Children}"  >
                    <StackPanel Orientation="Horizontal" Height="26"  >
                        <Image Source="{Binding IconSource}" Margin="3"/>
                        <TextBlock Text="{Binding Name}" Margin="3,5,3,3"/>
                        <TextBlock Text="{Binding TypeName}" Margin="0,5,3,3"/>
                    </StackPanel>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
            <TreeView.ContextMenu>
                <ContextMenu x:Name="_ctlEditMI">
                </ContextMenu>
            </TreeView.ContextMenu>
        </TreeView>
    </Grid>
</UserControl>
